
/**
 * display error message
 * 
 * @return
 */
function error(){
	
}

/**
 * display waiting process
 * @param element_id
 * @return
 */

function waiting(element_id){
	
}

/**
 * display complete following
 * @return
 */
function successFollowing(data){
        
	if(data["result"] == 1){
            $('#span_follow_action').html(data['message']);
        }else{
            $.jGrowl(data['message']);
        }
}
function successUnfollow(data){
    if(data["result"] == 1){
            $('#span_follow_action').html(data['message']);
        }else{
            $.jGrowl(data['message']);
        }
}
/**
 * Company script
 *
 */
function updateChild(parentId, childId, requestUrl){
    var parent = $(parentId).val();
    if( parent != 0){
        $.ajax({
            dataType:"htlm",
            beforeSend:function (XMLHttpRequest){updateBefore(childId)},
            error:function (XMLHttpRequest, textStatus, errorThrown) {alert(textStatus)},
            escape:false,
            success:function (data, textStatus) {$(childId).html(data)},
            type:"GET",
            url:requestUrl + parent
	});
    }else{
        $(childId).html('');
    }
}

function companySlug(userId, elementValue, elementUpdate){
	var val = $(elementValue).val();
	var reg = /\s|[\!\@\#\$\%\^&*()]/g;
	var regdot = /\.|[,;']/g;
	val = val.replace(reg, '_');
	val = val.replace(regdot, '');
        val = val.toLowerCase();
        val = userId + '_' + val;
	$(elementUpdate).html(val);
	$('#slug').attr('value', val);
        
}